/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * RSCamera.h
 *
 *  Created on: 2010/03/07
 *      Author: Alexandre Pires ( c.alexandre.pires@gmail.com )
 */

#ifndef RSCAMERA_H_
#define RSCAMERA_H_

#include "RSUIDElement.h"
#include <QMatrix4x4>

namespace Realsphere {

    class RSCamera : public Realsphere::RSUIDElement {
        Q_OBJECT
        Q_PROPERTY ( QString _attr_name READ Name WRITE SetName )
        public:
            Q_INVOKABLE RSCamera ( const QString& rId = QString::null, const QString& rName = QString::null );
            virtual ~RSCamera ();

        public:
            RSOptics*                   Optics () const;
            RSImager*                   Imager () const;
            QMatrix4x4                  ProjectionMatrix ();
            bool                        IsRootElement () const;

        public slots:
            RSError                     SetOptics ( RSOptics* rOptics );
            RSError                     SetImager ( RSImager* rImager );

        signals:
            void                        OpticsAdded ( RSOptics* rOptics );
            void                        OpticsRemoved ( RSOptics* rOptics );
            void                        ImagerAdded ( RSImager* rImager );
            void                        ImagerRemoved ( RSImager* rImager );
            void                        CameraChanged ();

        protected:
            RSError                     BeforeAddChildElement ( RSElement* rChild );
            bool                        AfterAddChildElement ( RSElement* rChild );
            bool                        AfterRemoveChildElement ( RSElement* rChild );

        private:
            RSOptics*                   mOptics;
            RSImager*                   mImager;
    };

}

#endif /* RSCAMERA_H_ */
